var domian = "https://www.easy-mock.com/mock/5aa77cbf2b0894377fc76640"
function singlist(method,url,data){
	var xhr = new XMLHttpRequest();
	xhr.open(method,url);
	xhr.setRequestHeader("singlist","qq_sing");
	xhr.send(data);
	xhr.addEventListener("readystatechange",function(){
		if(xhr.status==200&&xhr.readyState==4){
			add(xhr.response)
		}
	})
}
singlist("GET",domian+"/songlist")
function add(res){	
	var res = JSON.parse(res);
	console.log(res);
	var singList = res.songlist;
	var t = "";
	var cpuls = document.createDocumentFragment("ul");
	var uls = document.querySelector(".singlist_ul");
	cpuls = uls;
	var sum = 1; 
	singList.forEach(function(el){
		t+=`<li>
							<div class="sing_number">
								<span>${sum++}</span>
							</div>
							<div class="song_box">
								<div class="singer">
									
								
								<h3>${el.data.songname}</h3>
							${allsinglist(el.data.singer)}
								
								</div>
							</div>
						</li>
						`
	});
	cpuls.innerHTML+=t;
	function allsinglist(res){
		var t2 = "";
		
		res.forEach(function(el){
			t2+=`<p>${el.name}</p>`
		})
		return t2
	}
}
